﻿using Android.Content;
using Android.Content.Res;
using Android.Runtime;
using AndroidX.AppCompat.App;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NightPlayer.views
{
    public class BaseActivity : AppCompatActivity
    {
        public BaseActivity()
        {
        }

        protected BaseActivity(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
        {
        }

        protected bool isEink = true;
        protected override void AttachBaseContext(Context? @base)
        {

            isEink = Program.isEink;
            var conf = @base.Resources.Configuration;
            conf.Touchscreen = isEink ? TouchScreenType.Stylus : TouchScreenType.Finger;
            conf.Orientation = isEink ? Android.Content.Res.Orientation.Portrait : Android.Content.Res.Orientation.Undefined;
            base.AttachBaseContext(@base.CreateConfigurationContext(conf));
        }

    }
}
